//JS 中怎么定义对象的构造函数，怎么体现 JS 的继承关系，举例说明。

//构造函数绑定-apply/call方法
function Animal(head, foot) {
    this.foot = foot
    this.head = head

}

function catfamily(head, foot, color) {
    //Person.call(this,head,foot)
    Animal.apply(this, [head, foot])
    this.color = color
    this.show = function () {
        return "它有" + this.head + "个头," + this.foot + "只脚,是" + this.color + "的动物"
    }
}
let cat = new catfamily(1, 4, "白色")
app.innerHTML = cat.show()





// //拷贝继承
// function Animal() {

// }
// Animal.prototype.head = 1
// Animal.prototype.foot = 4


// function catfamily(color) {

//     this.color = color
//     this.show = function () {
//         return "它有" + this.head + "个头," + this.foot + "只脚,是" + this.color + "的"
//     }
// }
// Object.assign(catfamily.prototype, Animal.prototype)
// let stu = new catfamily("白色")
// app.innerHTML = stu.show()